﻿<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:nav="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
  xmlns:navCtl="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
  xmlns:ctl="clr-namespace:BookClub.Controls"
  x:Class="BookClub.MainPage"
  mc:Ignorable="d"
	d:DesignWidth="1024" d:DesignHeight="768"
  TextOptions.TextHintingMode="Animated">

  <Grid Style="{StaticResource screenGrid}">
    <Border Style="{StaticResource windowBorder}">
      <Grid>
        <Rectangle Style="{StaticResource leftColor}" />
        <Rectangle Style="{StaticResource topColor}" />
        <ctl:LoginControl VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,57,0" />

        <StackPanel VerticalAlignment="Top" Margin="50,30,57,0">
          <TextBlock Text="book club" Style="{StaticResource appTitleStyle}" />
          <StackPanel Orientation="Horizontal">
            <HyperlinkButton Style="{StaticResource linkButtonStyle}"
              Content="Books" TargetName="mainFrame" NavigateUri="/BookClub" />
            <HyperlinkButton Style="{StaticResource linkButtonStyle}"
              Content="My Book Shelf" TargetName="mainFrame" NavigateUri="/BookShelf"
              Visibility="{Binding Source={StaticResource webContext}, Path=Current.User, Converter={StaticResource requiresAuthConverter}}"/>
            <HyperlinkButton Style="{StaticResource linkButtonStyle}"
              Content="Members" TargetName="mainFrame" NavigateUri="/Members"
              Visibility="{Binding Source={StaticResource webContext}, Path=Current.User, Converter={StaticResource requiresAdminConverter}}" />
          </StackPanel>
        </StackPanel>

        <navCtl:Frame x:Name="mainFrame" Margin="50,145,37,20" Source="/BookClub">
          <navCtl:Frame.UriMapper>
            <nav:UriMapper>
              <nav:UriMapping Uri="" MappedUri="/Pages/BookClub.xaml" />
              <nav:UriMapping Uri="/{pageName}" MappedUri="/Pages/{pageName}.xaml"/>
            </nav:UriMapper>
          </navCtl:Frame.UriMapper>
        </navCtl:Frame>
      </Grid>
    </Border>
  </Grid>
</UserControl>
